<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl')?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
    <div class="col-xs-12 ">
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <div class="portlet box green ">
            <?=edit_form_caption(l($thisMethod).'任务')?>
            <div class="portlet-body form">
                <?=form_open('', Array('class'=>'form-horizontal', 'role'=>'form', 'id'=>'form_edit', 'data-category-id'=>$obj->id))?>
                <input type="hidden" id="update_time" name="update_time" value="<?=set_value('update_time', $obj->update_time)?>" />
                <div class="form-body">
                    <input type="hidden" name="creator_id" value="<?=$obj->creator_id ?>">

                    <?=edit_form_input('product_name', set_value('product_name', $obj->product_name), '任务商品名称')?>
                    <?=edit_form_input('related_shop', set_value('related_shop', $obj->related_shop), '下单店铺')?>

                    <div class="form-group">
                        <label class="col-xs-3 control-label">利润率</label>
                        <div class="col-xs-7">
                            <div class="input-group">
                                <input type="text" class="form-control" name="profit_rate" value="<?= $obj->profit_rate ?>">
                                <div class="input-group-addon">%</div>
                            </div>
                        </div>
                    </div>

                    <?=edit_form_input('price', set_value('price', $obj->price), '发布任务时商品的店铺价格','',true)?>
                    <?=edit_form_input('search_key', set_value('search_key', $obj->search_key), '商品搜索关键词')?>
                    <?=edit_form_input('amazon_order', set_value('amazon_order', $obj->amazon_order), '商品Amazon排名')?>
                    <?=edit_form_input('asin', set_value('asin', $obj->asin), '商品ASIN')?>
                    <?=edit_form_dropdown('country',IOSS_StaticConfig::getCountryInfo(), set_value('country', $obj->country), '所属国家')?>
                    <?=edit_form_input('link', set_value('link', $obj->link), '商品链接')?>
                    <?=edit_form_uploader('image', set_uploader('image', $obj->image), '商品图片')?>
                    <?=edit_form_input('sale_need_num', set_value('sale_need_num', $obj->sale_need_num), '要求销量总数','',true)?>
                    <?=edit_form_input('comment_need_num', set_value('comment_need_num', $obj->comment_need_num), '要求测评总数','',true)?>
                    <?=edit_form_textarea('requirement_desc', set_value('requirement_desc', $obj->requirement_desc), '任务要求具体描述')?>
                    <?=edit_form_dropdown('shop_id',$allShops, set_value('shop_id', $obj->shop_id), '所属账户')?>
                    <?php if ($this->_user->role_id == 4): ?>
                        <?=edit_form_input('', set_value('', $allDistribution[$obj->task_contact_id]), '分配组员','readonly')?>
                        <input type="hidden" name="task_contact_id" value="<?=$this->_user->id?>">
                    <?php else:?>
                        <?=edit_form_dropdown('task_contact_id',$allDistribution, set_value('task_contact_id', $obj->task_contact_id), '分配组员')?>
                    <?php endif; ?>
                    <?=edit_form_textarea('remark', set_value('remark', $obj->remark), '备注信息')?>
                    <?=edit_form_radio_list('is_urgent', MTask::getUrgent(), set_value('is_urgent', $obj->is_urgent?$obj->is_urgent:0), '是否加急')?>
                    <?=edit_form_radio_list('status', MTask::getState(), set_value('status', $obj->status?$obj->status:'1'), '状态')?>
                    <input type="hidden" name="group_id" value="<?=$this->_user->group_id ?>">
                </div>
                <?php $this->load->view('partials/submitButtons.tpl')?>
                <?=form_close()?>
            </div>
        </div>
    </div>
</div>
<link href="<?=image_url('/static/assets/global/plugins/jstree/dist/themes/default/style.min.css')?>" rel="stylesheet" type="text/css"/>

<script type="text/javascript">
    $(document).ready(function(){
        AjaxUploader.uploadTempUrl = "<?=site_url('/common/AjaxUpload/upload') . '/'  ?>";
        AjaxUploader.init();
    });
</script>
